package com.ak.common.configure;

import com.ak.common.handler.AKAccessDeniedHandler;
import com.ak.common.handler.AKAuthExceptionEntryPoint;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;

/**
 * 异常翻译配置
 *
 * @author Vean
 */
public class AuthExceptionConfigure {

	@Bean
    @ConditionalOnMissingBean(name = "accessDeniedHandler")
    public AKAccessDeniedHandler accessDeniedHandler() {
        return new AKAccessDeniedHandler();
    }

    @Bean
    @ConditionalOnMissingBean(name = "authenticationEntryPoint")
    public AKAuthExceptionEntryPoint authenticationEntryPoint() {
        return new AKAuthExceptionEntryPoint();
    }
}
